import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/project/:id/home', // :id 后面的path不能省略，否则主应用命中不了微应用
    name: '图谱构建',
    component: () => import(
      /* webpackChunkName: "knowledge-view" */ '../views/Test.vue'
    ),
  },
  {
    path: '/project/:id/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/About.vue'),
  },
]

export default routes
